import axios from 'axios'

axios.defaults.baseURL = 'http://47.122.16.71:3999/'

import { UToast } from 'undraw-ui'

// 拦截器统一处理错误
axios.interceptors.response.use(
  (response) => {
    return response
  },
  (err) => {
    UToast({ message: '服务器错误', type: 'error' })
    return Promise.reject(err)
  }
)

export default axios
